#include "widget.h"
#include "ui_widget.h"

#include <QDebug>
#include <fstream>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    std::ifstream f("D:\\23902\\Desktop\\1.txt");
    if(!f.is_open())
    {
        qDebug() << "打开文件失败";
        return;
    }
    std::string str;
    while(std::getline(f,str))
    {
        ui->comboBox->addItem(QString::fromStdString(str));
    }
    f.close();

}

Widget::~Widget()
{
    delete ui;
}
